import React from 'react';

import angleDoubleDown from './icons/angle-double-down.svg';
import angleDoubleUp from './icons/angle-double-up.svg';
import angleDoubleLeft from './icons/angle-double-left.svg';
import angleDoubleRight from './icons/angle-double-right.svg';
import angle from './icons/angle.svg';
import arrow from './icons/arrow.svg';
import bidirection from './icons/bidirection.svg';
import brain from './icons/brain.svg';
import chest from './icons/chest.svg';
import contrast from './icons/contrast.svg';
import coronary from './icons/coronary.svg';
import crosshairs from './icons/crosshairs.svg';
import curve from './icons/curve.svg';
import download from './icons/download.svg';
import ellipse from './icons/ellipse.svg';
import eraser from './icons/eraser.svg';
import exit from './icons/exit.svg';
import cardiac from './icons/cardiac.svg';
import hflip from './icons/hflip.svg';
import invert from './icons/invert.svg';
import length from './icons/length.svg';
import liver from './icons/liver.svg';
import lung from './icons/lung.svg';
import magnifier from './icons/magnifier.svg';
import mpr from './icons/mpr.svg';
import pan from './icons/pan.svg';
import probe from './icons/probe.svg';
import reset from './icons/reset.svg';
import roi from './icons/roi.svg';
import rotate from './icons/rotate.svg';
import rotate3d from './icons/rotate3d.svg';
import square from './icons/square.svg';
import stack from './icons/stack.svg';
import trash from './icons/trash.svg';
import vflip from './icons/vflip.svg';
import vr from './icons/vr.svg';
import zoom from './icons/zoom.svg';
import blendCom from './icons/blend-com.svg';
import blendMax from './icons/blend-max.svg';
import blendMin from './icons/blend-min.svg';
import blendAvg from './icons/blend-avg.svg';
import first from './icons/first.svg';
import previous from './icons/previous.svg';
import next from './icons/next.svg';
import last from './icons/last.svg';
import play from './icons/play.svg';
import top from './icons/top.svg';
import right from './icons/right.svg';
import bottom from './icons/bottom.svg';
import left from './icons/left.svg';
import checked from './icons/checked.svg';
import pointer from './icons/pointer.svg';
import stop from './icons/stop.svg';
import seriesLayout from './icons/series-layout.svg';
import imageLayout from './icons/image-layout.svg';
import studies from './icons/studies.svg';
import tools from './icons/tools.svg';
import share from './icons/share.svg';
import settings from './icons/settings.svg';
import help from './icons/help.svg';
import auto from './icons/auto.svg';
import downloadDicom from './icons/download-dicom.svg';
import downloadJpeg from './icons/download-jpeg.svg';
import about from './icons/about.svg';
import oneXone from './icons/1X1.svg';
import oneXtwo from './icons/1X2.svg';
import twoXone from './icons/2X1.svg';
import twoXtwo from './icons/2X2.svg';
import oneXthree from './icons/1X3.svg';
import threeXone from './icons/3X1.svg';
import twoXthree from './icons/2X3.svg';
import threeXtwo from './icons/3X2.svg';
import threeXthree from './icons/3X3.svg';
import wlChest from './icons/wl-chest.svg';
import wlAbdomen from './icons/wl-abdomen.svg';
import wlLung from './icons/wl-lung.svg';
import wlBone from './icons/wl-bone.svg';
import wlHead from './icons/wl-head.svg';
import wlBrain from './icons/wl-brain.svg';
import wlHeart from './icons/wl-heart.svg';
import asyncScroll from './icons/async-scroll.svg';
import cornerInfo from './icons/corner-info.svg';
import indexSync from './icons/index-sync.svg';
import patientInfo from './icons/patient-info.svg';
import positionSync from './icons/position-sync.svg';
import refLine from './icons/ref-line.svg';
import aircraft from './icons/aircraft.svg';
import checkedOutlined from './icons/checked-outlined.svg';
import t1b2 from './icons/t1b2.svg';
import t2b1 from './icons/t2b1.svg';
import l1r2 from './icons/l1r2.svg';
import l2r1 from './icons/l2r1.svg';

const ICONS = {
  'angle-double-down': angleDoubleDown,
  'angle-double-up': angleDoubleUp,
  'angle-double-left': angleDoubleLeft,
  'angle-double-right': angleDoubleRight,
  angle,
  arrow,
  bidirection,
  brain,
  chest,
  contrast,
  coronary,
  crosshairs,
  curve,
  download,
  ellipse,
  eraser,
  exit,
  cardiac,
  hflip,
  invert,
  length,
  liver,
  lung,
  magnifier,
  mpr,
  pan,
  probe,
  reset,
  roi,
  rotate3d,
  rotate,
  square,
  stack,
  trash,
  vflip,
  vr,
  zoom,
  'blend-com': blendCom,
  'blend-max': blendMax,
  'blend-min': blendMin,
  'blend-avg': blendAvg,
  first,
  previous,
  next,
  last,
  play,
  stop,
  top,
  right,
  bottom,
  left,
  checked,
  pointer,
  'series-layout': seriesLayout,
  'image-layout': imageLayout,
  studies,
  tools,
  share,
  settings,
  help,
  auto,
  'download-dicom': downloadDicom,
  'download-jpeg': downloadJpeg,
  about,
  'layout-1x1': oneXone,
  'layout-1x2': oneXtwo,
  'layout-2x1': twoXone,
  'layout-2x2': twoXtwo,
  'layout-1x3': oneXthree,
  'layout-3x1': threeXone,
  'layout-2x3': twoXthree,
  'layout-3x2': threeXtwo,
  'layout-3x3': threeXthree,
  'wl-chest': wlChest,
  'wl-abdomen': wlAbdomen,
  'wl-lung': wlLung,
  'wl-bone': wlBone,
  'wl-head': wlHead,
  'wl-brain': wlBrain,
  'wl-heart': wlHeart,
  'async-scroll': asyncScroll,
  'corner-info': cornerInfo,
  'index-sync': indexSync,
  'patient-info': patientInfo,
  'position-sync': positionSync,
  'ref-line': refLine,
  aircraft,
  'checked-outlined': checkedOutlined,
  'layout-T1+B2': t1b2,
  'layout-T2+B1': t2b1,
  'layout-L1+R2': l1r2,
  'layout-L2+R1': l2r1,
};

/**
 * Return the matching SVG Icon as a React Component.
 * Results in an inlined SVG Element. If there's no match,
 * return `null`
 */
export default function getIcon(key, props) {
  if (!key || !ICONS[key]) {
    return React.createElement('div', null, 'Missing Icon');
  }

  return React.createElement(ICONS[key], props);
}

export { ICONS };
